<?php

/**
 * Account form base class.
 *
 * @package    wifilez
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseAccountForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'account_id'           => new sfWidgetFormInputHidden(),
      'created'              => new sfWidgetFormDateTime(),
      'modified'             => new sfWidgetFormDateTime(),
      'email'                => new sfWidgetFormInput(),
      'password'             => new sfWidgetFormInput(),
      'cookie'               => new sfWidgetFormInput(),
      'role'                 => new sfWidgetFormInput(),
      'disabled'             => new sfWidgetFormInput(),
      'first_name'           => new sfWidgetFormInput(),
      'last_name'            => new sfWidgetFormInput(),
      'middle_name'          => new sfWidgetFormInput(),
      'company_name'         => new sfWidgetFormInput(),
      'address'              => new sfWidgetFormInput(),
      'city'                 => new sfWidgetFormInput(),
      'state'                => new sfWidgetFormInput(),
      'zip'                  => new sfWidgetFormInput(),
      'country'              => new sfWidgetFormInput(),
      'phone'                => new sfWidgetFormInput(),
      'mailing_list'         => new sfWidgetFormInput(),
      'update_list'          => new sfWidgetFormInput(),
      'subscription_id'      => new sfWidgetFormInput(),
      'subscriptionplan_id'  => new sfWidgetFormInput(),
      'subscription_card_id' => new sfWidgetFormInput(),
      'customer_reference'   => new sfWidgetFormInput(),
      'device_id'            => new sfWidgetFormInput(),
      'flash_id'             => new sfWidgetFormInput(),
      'good_sync_time'       => new sfWidgetFormDateTime(),
      'last_sync_time'       => new sfWidgetFormDateTime(),
      'last_sync_res'        => new sfWidgetFormInput(),
      'last_login'           => new sfWidgetFormDateTime(),
      'fb_uid'               => new sfWidgetFormInput(),
      'email_hash'           => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'account_id'           => new sfValidatorPropelChoice(array('model' => 'Account', 'column' => 'account_id', 'required' => false)),
      'created'              => new sfValidatorDateTime(array('required' => false)),
      'modified'             => new sfValidatorDateTime(array('required' => false)),
      'email'                => new sfValidatorString(array('max_length' => 128)),
      'password'             => new sfValidatorString(array('max_length' => 64)),
      'cookie'               => new sfValidatorString(array('max_length' => 40, 'required' => false)),
      'role'                 => new sfValidatorInteger(),
      'disabled'             => new sfValidatorInteger(),
      'first_name'           => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'last_name'            => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'middle_name'          => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'company_name'         => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'address'              => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'city'                 => new sfValidatorString(array('max_length' => 128, 'required' => false)),
      'state'                => new sfValidatorString(array('max_length' => 32, 'required' => false)),
      'zip'                  => new sfValidatorString(array('max_length' => 32, 'required' => false)),
      'country'              => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'phone'                => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'mailing_list'         => new sfValidatorInteger(array('required' => false)),
      'update_list'          => new sfValidatorInteger(array('required' => false)),
      'subscription_id'      => new sfValidatorInteger(array('required' => false)),
      'subscriptionplan_id'  => new sfValidatorInteger(array('required' => false)),
      'subscription_card_id' => new sfValidatorInteger(array('required' => false)),
      'customer_reference'   => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'device_id'            => new sfValidatorInteger(array('required' => false)),
      'flash_id'             => new sfValidatorString(array('max_length' => 64, 'required' => false)),
      'good_sync_time'       => new sfValidatorDateTime(array('required' => false)),
      'last_sync_time'       => new sfValidatorDateTime(array('required' => false)),
      'last_sync_res'        => new sfValidatorInteger(array('required' => false)),
      'last_login'           => new sfValidatorDateTime(array('required' => false)),
      'fb_uid'               => new sfValidatorInteger(),
      'email_hash'           => new sfValidatorString(array('max_length' => 64, 'required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Account', 'column' => array('email')))
    );

    $this->widgetSchema->setNameFormat('account[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Account';
  }


}
